svd — Singular Value Decomposition
svd
calculates the singular values, and different forms of the
left and right singular vectors. The
result is returned as three elements in a list. If we are performing
singular value decomposition of A, then
A = UIσVT
where U is the right singular vector, returned in u
, σ
is a vector of singular values, returned in sigma
, and VT is
the left singular value, returned in vt
.
Full singular values area always returned. However the form of the
left and right singular vectors is dependant on the
value of the optional string argument:
- "A" or "a"
- The full U, and VT are returned
- "S" or "s"
- A minimal version of U, and VT
are returned. This is the default.
- "N" or "n"
- U and VT are not computed, empty
u
and vt
elements are returned.
Full singular vectors means that the null-space is represented in the
singular values. This is the slowest option.
Minimal singular vectors means that sufficient U and VT are returned
to reproduce A. In general, for an argument of dimensions rxc, then if
r≥c,
Format |
U |
σ |
VT |
Full |
rxr |
1xc |
cxc |
Minimal |
rxc |
1xc |
cxc |
Nil |
0x0 |
1xc |
0x0 |
For r≤c, then
Format |
U |
σ |
VT |
Full |
rxr |
1xr |
cxc |
Minimal |
rxr |
1xr |
rxc |
Nil |
0x0 |
1xr |
0x0 |
Subsections